<?php
/**
 * Data Source Block
 * 
 * @author Xavier VILAIN
 * @package Orx\Etl\Extractor
 * @license #license-orx-etl#
 * 
 */

use Fox\Html\Block;
use Orx\Etl\Extractor\Source;
use Orx\Etl;
$xview = Xview::instance();
$block = new Block('bParams',Msg(Etl::BUNDLE,Etl::DATASOURCE_PARAMS));

$source = isset($params['source']) ? $params['source'] : $xview->val('source');

try {
	$datasource = Fox\Dao::load(Source::className(),$source);
	foreach($datasource->attributes() as $attribute) {
		$block->add($attribute);
	}
} catch (\Fox\Object\Exception\NotExist $e) {
			Fox\Message::Error($e);
}
return $block;